home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr13 / golisp.zip / CR.LSP < prev    next >
Text File  |  1995-01-20  |  954b  |  29 lines

  1. ; This function will copy and rotate an object
  2. ; using the ARRAY command.
  3. ;Bob Zelna
  4.  
  5. (DEFUN C:CR (/ OBJ RP P1 REF ANG ANG1 ANG2 ANS KIL)
  6.   (PRINC "\nSelect which objects to move...")
  7.   (SETQ OBJ (SSGET)
  8.         RP (GETPOINT"\nSelect your rotation point: ")
  9.         P1 (GETPOINT RP "\nPick the first endpoint: ")
  10.         REF (GETPOINT RP "\n...the second endpoint? ")
  11.         ANG1 (ANGLE RP P1)
  12.         ANG2 (ANGLE RP REF)
  13.         ANG (ABS (- ANG1 ANG2)))
  14.   (IF (> ANG PI)
  15.     (SETQ ANG (ABS (- ANG (* 2 PI))))
  16.   )
  17.   (SETQ ANG (ANGTOS ANG 0 6))
  18.   (PRINC"\nThe angle of rotation in degrees is ")
  19.   (PRINC ANG)
  20.   (SETQ ANS (STRCASE (GETSTRING"\nRotate counter-clockwise? <Y> "))
  21.         KIL (STRCASE (GETSTRING"\nDelete old objects? <Y> ")))
  22.   (IF (EQ ANS "N")
  23.     (SETQ ANG (STRCAT "-" ANG))
  24.   )
  25.   (COMMAND "ARRAY" OBJ "" "P" RP "2" "0" ANG "")
  26.   (IF (OR (EQ KIL "Y") (EQ KIL "")) (COMMAND "ERASE" OBJ ""))
  27.   (MENUCMD "S= ")
  28. )
  29.